class Solution {
public:
    string destCity(vector<vector<string>>& paths) {
        // 入度不为0，出度为0
        std::unordered_set<std::string> cityA_set;

        for (const vector<string>& path : paths) {
            cityA_set.insert(path[0]);
        }

        for (const vector<string>& path : paths) {
            if (cityA_set.count(path[1]) == 0) {
                return path[1];
            }
        }

        return "";
    }
};